<!--
  Generated template for the ScanListPage page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.
-->
<ion-header>

  <ion-navbar>
    <ion-title>盘点任务</ion-title>
    <ion-buttons end>
      <button ion-button icon-only (tap)="presentModal($event)"> 
          <ion-icon name='funnel'></ion-icon>
        </button>
  </ion-buttons> 
  </ion-navbar>

</ion-header>


<ion-content>
  <!-- 下拉刷新块 -->
  <ion-refresher (ionRefresh)="doRefresh($event)"> 
    <!-- <ion-refresher-content
        pullingIcon="arrow-dropdown"
        pullingText="下拉刷新"
        refreshingSpinner="circles"
        refreshingText="加载中...">  
      </ion-refresher-content> -->
      <ion-refresher-content >  
      </ion-refresher-content>
</ion-refresher>

  <ion-searchbar [(ngModel)]="searchValue" (ionInput)="getItems($event)" placeholder="搜索任务单"></ion-searchbar>
  <ion-list>
      <ion-item *ngFor="let item of items" (tap)="showDetail(item)">
        <ion-thumbnail item-start>
          <img src="/assets/imgs/product_list_default.png">
        </ion-thumbnail>
        <h2>{{item.sp_scan__scan_code}}</h2>
        <p>{{item.sp_scan__house_name}}</p>
        <p>{{item.sp_scan__scan_date}}</p>
        <span [ngSwitch]="item.sp_scan__scan_status" item-end>
          <ion-badge color="secondary" *ngSwitchCase="1">编辑清单</ion-badge> 
          <ion-badge color="secondary" *ngSwitchCase="2">生成清单</ion-badge> 
          <ion-badge color="secondary" *ngSwitchCase="3">盘点完成</ion-badge> 
          <ion-badge color="secondary" *ngSwitchCase="4">分析完成</ion-badge> 
        </span>
        <!-- <button ion-button clear item-end>查看</button> -->
      </ion-item>
    </ion-list>

    <!-- 上拉加载块 -->
    <ion-infinite-scroll (ionInfinite)="doInfinite($event)" immediate-check="false">
      <ion-infinite-scroll-content></ion-infinite-scroll-content>
    </ion-infinite-scroll>
</ion-content>
